package com.demo.mqtt.controller;

import com.demo.mqtt.service.UserService;
import com.demo.mqtt.vo.APIVO;
import com.demo.mqtt.vo.LoginPostVO;
import com.demo.mqtt.vo.RegisterPostVO;
import com.demo.mqtt.vo.RegisterVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by fukunaka on 2017/6/4.
 */
@RestController
@RequestMapping("/API")
public class APIController {
    @Autowired
    private UserService userService;

    @RequestMapping(value = "/reigster")
    public APIVO<RegisterVO> register(RegisterPostVO registerPostVO){


      return   userService.register(registerPostVO);
    }

    @RequestMapping(value = "/login")
    public APIVO<RegisterVO> login(LoginPostVO loginPostVO)
    {
        return userService.login(loginPostVO);
    }
}
